
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Abahe
 */
public class NotSupportedCanvas extends Canvas{

    private BTIMidlet midlet;
    
    public NotSupportedCanvas(BTIMidlet midlet){
        this.midlet = midlet;
        setFullScreenMode(true);
    }
    protected void paint(Graphics g) {
        g.setColor(0xffffff);
        g.fillRect(0, 0, BTIMidlet.WIDTH, BTIMidlet.HEIGHT);
        g.setColor(0xff0000);
        g.drawString("This Device is not Supported", 10, 10,
                Graphics.TOP | Graphics.LEFT);
        g.drawString("Exit", BTIMidlet.WIDTH - 60,
                BTIMidlet.HEIGHT - 25,
                Graphics.TOP | Graphics.LEFT);
    }

    protected void keyPressed(int keyCode) {
        if(keyCode == -7){
            midlet.exit();
        }
    }
}
